<?php
require './RunDbPdo.php';
require './RedisQ.php';
require './MmCache.php';
$model = new RunDbPdo();
$redis = new RedisQ();
$mem  = new MmCache();

if(isset($_GET) && !empty($_GET)){
    extract($_GET);
    $user_id = isset($user_id)?$user_id:0;
    $slice = $user_id%2;
    $model->configFile = "./dbconfig/user{$slice}.config.php";
    $sql = "DELETE FROM mm_users{$slice} WHERE user_id={$user_id}";
    $re = $model->query($sql);
    if($re){
        $sql = "DELETE FROM mm_users WHERE user_id={$user_id}";
        $res = $redis->lpush('sql', $sql);
        if($res){
            $key = "{user_id:$user_id}";
            $mem->remove($key);
            header('location:select.php?user_id='.$user_id);
        }
    }
}

